package cn.ecnu.pojo.resume;

import cn.ecnu.common.validated.InsertGroup;
import cn.ecnu.common.validated.UpdateGroup;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;

@Data
@TableName(value = "resume_job")
/*求职者-工作经历 */
public class ResumeJob {

//    @Null(message = "数据添加时，jobId不能赋值",groups = InsertGroup.class)
//    @NotNull(message = "数据更新时，jobId不能为空",groups = UpdateGroup.class)
    @TableId(value = "job_id", type = IdType.AUTO)
    private Integer jobId;

    @NotNull(message = "userId不能为空")
    private Integer userId;

    @NotBlank(message = "公司名称不能为空")
    private String company;

    @NotBlank(message = "岗位不能为空")
    private String position;

    @NotBlank(message = "所在行业不能为空")
    private String industry;

    @NotBlank(message = "工作类型不能为空")
    private String jobType;

    @NotBlank(message = "工作地不能为空")
    private String jobLocation;

    private String jobDetail;

    @JsonFormat(pattern = "yyyy-MM")
    @NotNull(message = "工作起始时间不能为空")
    private Date jobStart;

    @JsonFormat(pattern = "yyyy-MM")
    @NotNull(message = "工作结束时间不能为空")
    private Date jobEnd;

    @Override
    public String toString() {
        return "{" +
                "公司:" + company +
                ", 职位:" + position  +
                ", 行业:" + industry  +
                ", 类型:" + jobType  +
                ", 详情:" + jobDetail  +
                '}';
    }
}
